﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Practices.Composite.Regions;
using Microsoft.Practices.Composite.Events;
using OrderEntryManagement.Modules.Customer.Views;
using OrderEntryManagement.Infrastructure;

namespace OrderEntryManagement.Modules.Customer
{
    public class CustomerController : ICustomerController
    {

        private readonly IRegionManager regionManager;
        private readonly IEventAggregator eventAggregator;
        private readonly IRegion bottomRightRegion;
        private readonly IRegion bottomLeftRegion;

        public CustomerController(IRegionManager regionManager, IEventAggregator eventAggregator)
        {
            this.regionManager = regionManager;
            this.eventAggregator = eventAggregator;

            this.bottomRightRegion = this.regionManager.Regions[RegionNames.BottomRightRegion];
            this.bottomLeftRegion = this.regionManager.Regions[RegionNames.BottomLeftRegion];

            //eventAggregator.GetEvent<GenerateOrderEvent>().Subscribe(CreateOrder, ThreadOption.UIThread);
        }



        public void Run()
        {
            FindCustomersView findCustomersView = new FindCustomersView();
            bottomLeftRegion.Add(findCustomersView);
            bottomLeftRegion.Activate(findCustomersView);
        }
    }
}
